package com.epalmpay.service.jobservice;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.epalmpay.entity.Page;
import com.epalmpay.entity.TradeOffline;


/**
 * Created by wzq on 2017/6/2.
 */
public interface IProfitStatisService {
    //生效月分润比例设置(格式yyyymm01)
	public int saveValidProfitSetting(Date statisDate) throws Exception;

	//查询需要分润的交易记录	
	public List<TradeOffline> selectNeedProfitList(Date selectDate) throws Exception;
	//单笔交易分润计算
    public int saveOneOrderProfitCalculate(TradeOffline record) throws Exception;

	/**
	 * 单笔交易分润计算(异步执行)
	 * @param orderId
	 * @return
	 * @throws Exception
	 */
	public int saveOneOrderProfitCalculate(Long orderId) throws Exception;

	//查询需要分润退款的交易记录	
	public List<TradeOffline> selectNeedProfitRefundList(Date selectDate) throws Exception;
	//单笔交易分润退款计算
    public int saveOneOrderProfitRefund(TradeOffline record) throws Exception;    
    
	//分润日统计
	public int saveProfitDayStatis(Date statisDate) throws Exception;    
	//分润月统计(格式yyyymm01)
	public int saveProfitMonthStatis(Date statisDate) throws Exception;

	//分润打款月任务方法
	public int profitOutMontyMonth(Date statisDate) throws Exception;
	
	//已知分润金额，进行计算
	public int oneOrderProfitCalculate(TradeOffline record, Integer profitAmount) throws Exception;
	
}
